<template>
  <div id="app">
    <BaseHeader v-if="isRouterAlive" />
    <router-view v-if="isRouterAlive" class="VIEW" style="    width: 1487px;"></router-view>
    <BaseFooter />
  </div>
</template>

<script>
import BaseHeader from "./components/common/BaseHeader"; //导航栏
import BaseFooter from "./components/common/BaseFooter"; //底部栏
export default {
  name: "App",
  provide() {
    return {
      reload: this.reload
    };
  },
  data() {
    return {
      isRouterAlive: true,
    };
  },
  methods: {
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(function() {
        this.isRouterAlive = true;
      });
    }
   
  },
  components: {
    BaseHeader,
    BaseFooter
  },
  created: function() {
    var d;

    // this.$api.userAPI.login({"username":"123","password":"123"});
    // this.$api.userAPI.get_information();

    // d = {
    //     sceneryId:1,
    //     text:1,
    //     imgs:1,
    //     graded:1,
    // }
    // this.$api.commentAPI.post_comment(d);

    // d =  {id:1}
    // this.$api.commentAPI.get_comment(d);

    // d =  {id:1}
    // this.$api.hotelAPI.get_hotel(d);

    // this.$api.orderAPI.get_userOrder();

    // d =  {id:1}
    // this.$api.orderAPI.get_hotelReserve(d);

    // d =  {id:1}
    // this.$api.orderAPI.post_hotelReserve(d);

    // d =  {id:1}
    // this.$api.orderAPI.post_ticketReserve(d);

    // d =  {id:1}
    // this.$api.orderAPI.get_ticketReserve(d);

    // d =  {id:1}
    // this.$api.sceneryAPI.get_scenery_tickets(d);

    // d = { id: 1 };
    // this.$api.sceneryAPI
    //   .get_scenery(d)
    //   .then(res => {
    //     const data = res.data;
    //     console.log(data);
    //   })
    //   .catch(err => {});
    // this.$api.sceneryAPI.get_scenery();

    // this.$api.strategyAPI.get_strategy();

    // d = {id:1}
    // this.$api.strategyAPI.get_strategy(d);
  }
};
</script>

<style lang="scss" type="text/css">
@import "@/util/style.scss";

* {
  margin: 0;
  padding: 0;
}
#app {
  width: 100%;
  height: 100%;
  background: #f0f2f5;
}
.VIEW{

  
  margin: auto;
  padding: 5px;
}
</style>
